package com.actionpals.geom
{
	/**
	 * The Tint class stores the two tint values, color and multiplier.
	 * 
	 * @author Mark Walters
	 */	
	public class Tint
	{
		private var _color:uint = 0;
		private var _multiplier:Number = 0;
		
		/**
		 * Constructor.
		 * 
		 * @param color The tinting color value in the 0xRRGGBB format.
		 * @param multiplier The percentage to apply the tint color, as a decimal value between 0 and 1.
		 */	
		public function Tint( color:uint, multiplier:Number )
		{
			this.color = color;
			this.multiplier = multiplier;
		}
		
		/**
		 * The tinting color value in the 0xRRGGBB format.
		 */	
		public function get color():uint
		{
			return _color;
		}
		
		/**
		 * @private
		 */	
		public function set color( value:uint ):void
		{
			_color = value;
		}
		
		/**
		 * The percentage to apply the tint color, as a decimal value between 0 and 1.
		 * When tintMultiplier = 0, the color is its original color and no tint color is visible.
		 * When tintMultiplier = 1, the color is completely tinted and none of its original color is visible.
		 */	
		public function get multiplier():Number
		{
			return _multiplier;
		}
		
		/**
		 * @private
		 */	
		public function set multiplier( value:Number ):void
		{
			_multiplier = Math.max( Math.min( value, 1 ), 0 );
		}
		
		/**
		 * The string version of a Tint object.
		 */	
		public function toString():String
		{
			return "[Tint color=" + color + " multiplier=" + multiplier + "]";
		}
		
	}
}